package com.zyz.demo.service;

import com.zyz.demo.mapper.BlogMapper;
import com.zyz.demo.model.BlogInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BlogService {
    @Autowired
    private BlogMapper blogMapper;

    public List<BlogInfo> getList() {
        return blogMapper.getBlogAll();
    }

    public BlogInfo getBlogById(Integer id) {
        return blogMapper.selectBlogInfoByBlogId(id);
    }

    public Integer addBlog(BlogInfo blogInfo) {
        return blogMapper.addBlog(blogInfo);
    }

    public Integer updateBlog(BlogInfo blogInfo) {
        return blogMapper.updateBlogByBlogId(blogInfo);
    }
}
